﻿<UserControl x:Class="LFSRecord2.View.ViewportView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:vm="clr-namespace:LFSRecord2.ViewModel"
             xmlns:lfsvstruct="clr-namespace:LFSRecord2.View.ViewportStructures"
             mc:Ignorable="d" 
             d:DesignWidth="300" d:DesignHeight="300"
             KeyDown="ViewportView_KeyDown" Focusable="True"
             Width="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ItemsControl}}, Path=ActualWidth}"
             Height="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ItemsControl}}, Path=ActualHeight}"
             Loaded="ViewportView_Loaded">
    <Grid SizeChanged="Viewport_SizeChanged" Background="#FF6E6E6E">
        <Viewport3D Name="vp3D" IsHitTestVisible="False" Margin="0,0,0,26" Focusable="False" />
        <Canvas Name="tab3DCanvas" Background="Transparent" MouseDown="viewportCanvas_MouseDown" MouseWheel="viewportCanvas_MouseWheel" Margin="0,0,0,26" ClipToBounds="True">
            <Canvas Name="tab2DCanvas" Width="2560" Height="2560">
                <Image Name="Map2DImage" Width="2560" Height="2560" Stretch="None" IsHitTestVisible="False" />
                <ItemsControl Name="LayerItems" ItemsSource="{Binding AllLayers}" Focusable="False">
                    <ItemsControl.ItemsPanel>
                        <ItemsPanelTemplate>
                            <Canvas />
                        </ItemsPanelTemplate>
                    </ItemsControl.ItemsPanel>
                    <ItemsControl.ItemTemplate>
                        <DataTemplate>
                            <lfsvstruct:CompLayerViewObject DataContext="{Binding}" />
                        </DataTemplate>
                    </ItemsControl.ItemTemplate>
                </ItemsControl>
            </Canvas>
        </Canvas>
        <Border BorderBrush="DimGray" BorderThickness="2" Height="26" VerticalAlignment="Bottom" Background="#FF787878">
            <StackPanel Orientation="Horizontal">
                <ComboBox Name="ScaleSelectionBox" 
                          Width="60" Height="22" 
                          Margin="5,0,0,0" 
                          HorizontalAlignment="Left" 
                          SelectionChanged="ScaleSelectionBox_SelectionChanged" 
                          Focusable="False" />
                <ComboBox Name="ViewSelectionBox" 
                          Width="125" Height="22" 
                          Margin="5,0,0,0" 
                          HorizontalAlignment="Left" 
                          SelectionChanged="ViewSelectionBox_SelectionChanged" 
                          Focusable="False" />
                <!--<Button Content="sync with lfs" Command="{Binding GetCPPCommand}" Height="22" VerticalAlignment="Bottom" HorizontalAlignment="Right" Width="70" Focusable="False" />-->
            </StackPanel>
        </Border>
    </Grid>
</UserControl>
